import request from "@/utils/request";
// 获取用户信息的 API
export const getUserInfo = (token) => {
    return request({
        url: '/user/getUserInfo',
        headers: {
            Authorization: token
        }
    })
}
export const getUserPage = (currentPage, pageSize) => {

    return request({
        url: 'user/page',
        params: {
            currentPage,
            pageSize,
        },
    })
}
export function addUser(data){

    return request({
        url: 'user',
        method: 'post',
        data
    })
}
export function updateUser(data){

    return request({
        url: 'user',
        method: 'put',
        data
    })
}
export function deleteUser(data){

    return request({
        url: 'user',
        method: 'delete',
        data
    })
}
export function resetPassword(userId) {
    return request({
        url: `user/${userId}`, // 假设使用用户 ID 重置密码
        method: 'put'
    });
}
export function updatePw(data) {
    return request({
        url: `user/updatePw`, // 假设使用用户 ID 重置密码
        method: 'put',
        data,
    });
}
